<!DOCTYPE html>
<html lang="en">
	<head>
		<title>Gravity simulate, Golang parallel computing, Websocket communicating, WebGL drawing 3D display</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <meta name="keywords" content="go,并行计算,万有引力,webgl,websocket"/>
        <meta name="description" content="go并行计算模拟万有引力,使用websocket与前端通信，使用threejs实现webgl下的3d展示。"/>
		<style>
			body {
				color: #cccccc;
				font-family:Monospace;
				font-size:13px;
				text-align:center;

				background-color: #050505;
				margin: 0px;
				overflow: hidden;
			}

			#info {
				position: absolute;
				top: 0px; width: 100%;
				padding: 5px;
			}

			a {
				color: #0080ff;
			}
		</style>
        <script src="../js/websocket.js"></script>
	</head>
	<body>

		<div id="container"></div>
		<div id="info"></div>
        <div style="position: absolute; top: 10px; left: 20px;">
            websocket server:<input name="ws-addr" id="ws-addr" value=""/><button id="reConnect">yes</button><br/>
            &nbsp;&nbsp;send content:<input name="k" id="send-val" value="cmd=orbs&k=thelist1"/><button id="btnSend">yes</button><br/>
            <div id="ws-msg">
            websocket not already.
            </div>  
        </div>
        <div style="position: absolute; top: 10px; right: 20px;">
            Zoom: <button id="zoom_down">&nbsp;-&nbsp;</button><input id="zoom" value="1.0" readonly/><button id="zoom_up">&nbsp;+&nbsp;</button><br/>
            <br/>
            star me: <a href="https://github.com/uxff/gravity_sim_go" target="_blank">github.com/uxff/gravity_sim_go</a><br/>
            cube style: <a href="/index.html" target="_blank">link cube style</a><br/>
        </div>
		<script type="x-shader/x-vertex" id="vertexshader">

			attribute float size;
			attribute vec3 customColor;

			varying vec3 vColor;

			void main() {

				vColor = customColor;

				vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );

				gl_PointSize = size * ( 300.0 / -mvPosition.z );

				gl_Position = projectionMatrix * mvPosition;

			}

		</script>

		<script type="x-shader/x-fragment" id="fragmentshader">

			uniform vec3 color;
			uniform sampler2D texture;

			varying vec3 vColor;

			void main() {

				gl_FragColor = vec4( color * vColor, 1.0 );

				gl_FragColor = gl_FragColor * texture2D( texture, gl_PointCoord );

			}

		</script>

		<script src="./build/three.js"></script>

		<script src="js/Detector.js"></script>
		<script src="js/libs/stats.min.js"></script>
        <script src="js/controls/OrbitControls.js"></script>

        <!--
        <script src="/js/jquery-1.9.1.min.js"></script>
        -->
        <script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
        <script src="./webgl_buffergeometry_points.js"></script>

		<script>
		</script>

	</body>
</html>
